package com.example.homeworkhelper.result.request;

import com.example.homeworkhelper.utils.common.Config;

import java.io.IOException;

import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.FormBody;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;

public class ResultRequestUtils {

    public void getMistake(String search_id) {
//        String url = Config.HttpUrlHead + "/helper/result/getMistake";
//        RequestBody requestBody = new FormBody.Builder()    //构建body
//                .add("search_id", search_id)
//                .build();
//        Request request = new Request.Builder()
//                .url(url)
//                .post(requestBody)
//                .build();
//        OkHttpClient okHttpClient = new OkHttpClient();
//        okHttpClient.newCall(request).enqueue(new Callback() {
//            @Override
//            public void onFailure(Call call, IOException e) {
//                e.printStackTrace();
//            }
//
//            @Override
//            public void onResponse(Call call, Response response) throws IOException {
//                System.out.println(response.protocol() + "::::" + response.message());
//                is_marked = Integer.parseInt(response.body().string());
//                mistakeAdd.setSelected(is_marked == 1);
//            }
//        });
    }
}
